{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5a59eb5d-ce4a-4f61-aef1-38ed6ab17a34",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "头总数: 5\n",
      "脚总数: 15\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "鸡： 2.5 兔： 2.5\n",
      "鸡：2 兔：2\n"
     ]
    }
   ],
   "source": [
    "h=int(input(\"头总数:\"))\n",
    "f=int(input(\"脚总数:\"))\n",
    "x=2*h-f/2\n",
    "y=f/2-h\n",
    "print(\"鸡：\", x,\"兔：\",y)\n",
    "print(\"鸡：%d 兔：%d\"%(x,y))    #格式控制输出\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a4134a5-da65-45be-8802-059d221e9c72",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
